Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use policyName sent back with public rooms for people who aren't in the workspace #15546

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

jasperhuangg
Copy link
Contributor

@jasperhuangg jasperhuangg commented Feb 28, 2023

Needs https://github.com/Expensify/Web-Expensify/pull/36595

Details

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/263074

Tests

  1. Create a new workspace, save the reportID of the #announce room.
  2. ./script/sql.sh and run the following query to update the visibility rNVP to be "public_announce":
    INSERT INTO reportNameValuePairs (reportID, name, value) VALUES (<reportID>, "visibility", "public_announce");
  3. Sign out of the account that created the workspace, and sign into a different account that isn't in the workspace.
  4. Navigate to the #announce room (i.e. localhost:8080/r/<reportID)
  5. Verify that the policyName appears in the subtitle in the header of the report screen.

QA Steps

REQUIRES RING3

  1. Create a new workspace, save the reportID for of the #announce room.
  2. ./script/sql.sh and run the following query to update the visibility rNVP to be "public_announce":
    INSERT INTO reportNameValuePairs (reportID, name, value) VALUES (<reportID>, "visibility", "public_announce");
  3. Sign out of the account that created the workspace, and sign into a different account that isn't in the workspace.
  4. Navigate to the #announce room (i.e. staging.new.expensify.com/r/<reportID)
  5. Verify that the policyName appears in the subtitle in the header of the report screen.

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web Screenshot 2023-02-27 at 6 53 40 PM
Mobile Web - Chrome Screenshot 2023-02-27 at 7 15 19 PM Screenshot 2023-02-27 at 7 15 15 PM
Mobile Web - Safari Screenshot 2023-02-27 at 7 05 59 PM Screenshot 2023-02-27 at 7 06 04 PM
Desktop Screenshot 2023-02-27 at 7 04 18 PM
iOS Screenshot 2023-02-27 at 7 05 04 PM Screenshot 2023-02-27 at 7 05 12 PM
Android Screenshot 2023-02-27 at 7 14 49 PM Screenshot 2023-02-27 at 7 14 53 PM

@jasperhuangg jasperhuangg self-assigned this Feb 28, 2023
@jasperhuangg jasperhuangg requested a review from a team as a code owner February 28, 2023 02:51
@jasperhuangg jasperhuangg marked this pull request as draft February 28, 2023 02:51
@melvin-bot melvin-bot bot requested review from danieldoglas and removed request for a team February 28, 2023 02:52
@MelvinBot
Copy link

@danieldoglas Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@jasperhuangg jasperhuangg changed the title Use policyName sent back with public rooms for people who aren't in t… [HOLD Web-Expensify#36595] Use policyName sent back with public rooms for people who aren't in t… Feb 28, 2023
@jasperhuangg jasperhuangg changed the title [HOLD Web-Expensify#36595] Use policyName sent back with public rooms for people who aren't in t… [HOLD Web-Expensify#36595] Use policyName sent back with public rooms for people who aren't in the workspace Feb 28, 2023
@jasperhuangg jasperhuangg added the InternalQA This pull request required internal QA label Feb 28, 2023
@jasperhuangg jasperhuangg marked this pull request as ready for review February 28, 2023 03:15
@jasperhuangg
Copy link
Contributor Author

@iwiznia do you mind completing the PR Reviewer checklist please?

@marcochavezf
Copy link
Contributor

marcochavezf commented Mar 1, 2023

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Screen.Recording.2023-03-01.at.16.12.44.mov
Mobile Web - Chrome
Screen.Recording.2023-03-01.at.16.18.15.mov
Mobile Web - Safari
Screen.Recording.2023-03-01.at.16.16.44.mov
Desktop Screenshot 2023-03-01 at 16 29 11
iOS
Android

Copy link
Contributor

@marcochavezf marcochavezf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I haven't been able to test it locally on iOS and Android (something's up with my ruby env), but given that we're only checking that the public chat is shown for non-policy members, I completed the checklist to unblock the PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2023

⚠️ ⚠️ Heads up! This pull request has the CP Staging label ⚠️ ⚠️
If you applied the CP Staging label before the PR was merged, the PR will be be immediately deployed to staging even if the open StagingDeployCash deploy checklist is locked.
However if you applied the CP Staging after the PR was merged it's possible it won't be CP'ed automatically. If you need it to be CP'ed to staging, tag a member of @Expensify/mobile-deployers to CP it manually, otherwise you can wait for it to go out with the next deploy.

@jasperhuangg jasperhuangg changed the title [HOLD Web-Expensify#36595] Use policyName sent back with public rooms for people who aren't in the workspace Use policyName sent back with public rooms for people who aren't in the workspace Mar 2, 2023
@jasperhuangg
Copy link
Contributor Author

https://github.com/Expensify/Web-Expensify/pull/36595#issuecomment-1451280865 Web-E PR is on prod, so merging this!

@jasperhuangg jasperhuangg merged commit bff8b0b into main Mar 2, 2023
@jasperhuangg jasperhuangg deleted the jasper-policyNameForPublicRooms branch March 2, 2023 05:30
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
Open Search Page TTI 617.068 ms → 660.835 ms (+43.767 ms, +7.1%)
App start TTI 704.708 ms → 725.617 ms (+20.908 ms, +3.0%)
App start runJsBundle 194.290 ms → 202.844 ms (+8.553 ms, +4.4%)
App start nativeLaunch 19.387 ms → 20.594 ms (+1.207 ms, +6.2%)
App start regularAppStart 0.014 ms → 0.015 ms (+0.001 ms, +6.3%)
Show details
Name Duration
Open Search Page TTI Baseline
Mean: 617.068 ms
Stdev: 24.075 ms (3.9%)
Runs: 574.672038000077 580.0121260005981 588.4678549990058 588.4977619983256 588.9800629988313 590.8003739994019 591.1504319999367 596.7412519995123 599.19095900096 602.0908199995756 607.1266270000488 607.6813559997827 608.3922119997442 608.9428719989955 609.5229490008205 610.6582839991897 611.7963470015675 613.847494000569 616.2549230009317 616.7164719998837 622.4154460001737 625.7910159993917 627.262817999348 627.8454599995166 635.90970900096 638.687419001013 642.3868819996715 645.148520000279 651.1027429997921 654.9372969996184 656.0128180012107 660.1034759990871 664.0905770007521

Current
Mean: 660.835 ms
Stdev: 27.686 ms (4.2%)
Runs: 606.8376869987696 611.5981850009412 612.0032139997929 621.5115159992129 631.8680429998785 637.421305000782 640.3989259991795 642.7318939995021 645.5231940001249 649.1161710005254 649.3998619988561 649.9905200004578 652.7578130010515 652.8098959997296 656.2358410004526 657.0170910004526 657.8100579995662 663.7624929994345 664.5864270012826 664.7755539994687 667.5558679997921 672.0688889995217 673.6916910000145 675.9355880003422 677.4169110003859 679.6206870004535 679.9428309984505 685.241374000907 689.8603930007666 691.1328130010515 707.7742929998785 715.1735030002892 723.9856770001352
App start TTI Baseline
Mean: 704.708 ms
Stdev: 30.297 ms (4.3%)
Runs: 650.9076000005007 654.0191130004823 662.8580649998039 668.7821960002184 682.5692040007561 682.5785959996283 685.810794999823 687.1778369992971 690.3991880007088 691.5850779991597 693.9340530000627 695.7697969991714 697.1313870009035 698.0521590001881 699.4356449991465 699.9066700004041 704.1005700007081 704.212695999071 704.324488999322 706.1348110008985 708.7869029995054 718.8903960008174 719.2334000002593 727.8307859990746 731.1279579997063 734.0577589999884 734.7461350001395 747.8775869999081 770.0012389998883 789.0052279997617

Current
Mean: 725.617 ms
Stdev: 30.686 ms (4.2%)
Runs: 666.2974619995803 682.6000430006534 690.7488770000637 691.5730489995331 692.0115269999951 692.227629000321 696.2775800004601 696.4116149991751 697.4815909992903 703.4038709998131 707.3263939991593 710.2495140004903 715.4356350004673 716.5722259990871 720.8168759997934 726.0070190001279 726.2760669998825 727.2022610008717 729.1132559999824 729.1383439991623 733.786064999178 738.7972369994968 739.1679740007967 743.5788449998945 749.5796160008758 759.404041999951 762.7266230005771 765.8670019991696 769.9289129991084 774.2063839994371 779.4053780008107 786.1168869994581
App start runJsBundle Baseline
Mean: 194.290 ms
Stdev: 17.512 ms (9.0%)
Runs: 159 165 167 171 174 174 180 180 183 186 186 189 189 189 193 194 195 195 201 202 203 209 211 212 212 214 215 216 218 219 222

Current
Mean: 202.844 ms
Stdev: 23.464 ms (11.6%)
Runs: 170 170 173 178 180 180 181 183 183 187 188 190 190 191 193 193 202 206 206 206 207 212 216 218 220 225 229 231 236 239 248 260
App start nativeLaunch Baseline
Mean: 19.387 ms
Stdev: 1.336 ms (6.9%)
Runs: 17 17 17 18 18 18 18 19 19 19 19 19 19 19 19 19 19 19 20 20 20 20 20 20 21 21 21 21 21 22 22

Current
Mean: 20.594 ms
Stdev: 2.620 ms (12.7%)
Runs: 17 17 18 18 18 18 18 19 19 19 19 19 19 20 20 20 20 20 21 21 21 21 21 21 22 23 23 23 24 26 27 27
App start regularAppStart Baseline
Mean: 0.014 ms
Stdev: 0.001 ms (6.2%)
Runs: 0.012330001220107079 0.012411000207066536 0.012531999498605728 0.012614000588655472 0.012654999271035194 0.012736000120639801 0.01285800151526928 0.012938998639583588 0.013102000579237938 0.013102000579237938 0.013224000111222267 0.01342800073325634 0.013508999720215797 0.013549000024795532 0.013671999797224998 0.013671999797224998 0.013753000646829605 0.013916000723838806 0.014201000332832336 0.014201000332832336 0.014241000637412071 0.014241000637412071 0.014281999319791794 0.014282001182436943 0.014364000409841537 0.014527000486850739 0.014566998928785324 0.015015000477433205 0.01505499891936779 0.015095999464392662 0.015258001163601875

Current
Mean: 0.015 ms
Stdev: 0.001 ms (6.3%)
Runs: 0.013101998716592789 0.013223998248577118 0.013630999252200127 0.013712000101804733 0.013753999024629593 0.013916000723838806 0.013955999165773392 0.013956001028418541 0.013956999406218529 0.013996999710798264 0.014120001345872879 0.014201000332832336 0.014241999015212059 0.014282001182436943 0.014322999864816666 0.014322999864816666 0.014363998547196388 0.014364000409841537 0.014445001259446144 0.014485999941825867 0.014526000246405602 0.014689000323414803 0.01477000117301941 0.014770999550819397 0.015298999845981598 0.015381000936031342 0.015542998909950256 0.015583999454975128 0.015625 0.016397999599575996 0.01664300076663494 0.017009001225233078

@OSBotify
Copy link
Contributor

OSBotify commented Mar 2, 2023

🚀 Deployed to staging by https://github.com/jasperhuangg in version: 1.2.78-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

OSBotify commented Mar 6, 2023

🚀 Deployed to production by https://github.com/mountiny in version: 1.2.78-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
InternalQA This pull request required internal QA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants